<?php

	include("../config.php");
	include(INCLUDEDIR."core.php");
	
	db::Connect();
	
	//if(!isset($_GET['term'])) exit();
	$id = isset($_GET['id'])?intval($_GET['id']):0;
		
		
	$query = "	SELECT id_estado,nombre_estado FROM estados ORDER BY nombre_estado ASC";

	$result = mysql_query($query);
	$posts = array();
	if($result && mysql_num_rows($result)>0) {
		while($row = mysql_fetch_array($result)) {
			$row[1] = utf8_encode($row[1]);
			$posts[] = array( $row['0'],$row['1']) ;
			
		}
	}
	
	@mysql_close();
	
	echo(json_encode($posts));
	
?>